import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'  //引入axios




//用axios的拦截器,加上请求头
axios.interceptors.request.use(
  config =>{
   let jwt = localStorage.getItem("thoken");
   if(jwt){
    config.headers.thoken = jwt;
   }
   return config;
  }
)

Vue.prototype.$axios = axios //把axios配置全局的变量，变量名是$axios


Vue.config.productionTip = false
Vue.use(ElementUI);

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
